package cn.smile.controller;

import cn.smile.annotation.PermissionName;
import cn.smile.pojo.Permission;
import cn.smile.service.PermissionService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.method.HandlerMethod;
import org.springframework.web.servlet.mvc.method.RequestMappingInfo;
import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter;
import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping;

import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: MaoSuyu
 * @User：John
 * @Date: 2019/7/4
 * @Time: 17:06
 * @Description: No Description
 */
@RestController
public class OtherController {

    @Autowired
    private PermissionService permissionService;

    /**
     * 刷新权限
     *
     * @return
     */
    @RequestMapping("/refresh")
    @RequiresPermissions("USER:REFRESH")
    @PermissionName(permissionName = "刷新权限")
    public String refresh() {
        permissionService.refreshPermission();
        return "刷新权限";
    }

}
